#/bin/sh

basedir=`dirname $0`

if [ -f ${basedir}'/wifi_deamon' ] && [ -f ${basedir}'/RT2870AP.dat.bak' ] && [ -f ${basedir}'/rtutil7601Uap.ko' ] && [ -f ${basedir}'/mt7601Uap.ko' ] && [ -f ${basedir}'/rtnet7601Uap.ko' ]; then
  insmod ${basedir}'/rtutil7601Uap.ko'
  if grep -q "rtutil7601Uap " /proc/modules ; then
    insmod ${basedir}'/mt7601Uap.ko'
    if grep -q "mt7601Uap " /proc/modules ; then
      insmod ${basedir}'/rtnet7601Uap.ko'
      if grep -q "rtnet7601Uap " /proc/modules ; then
        ${basedir}'/wifi_deamon'
      fi
    fi
  fi
fi
